﻿using System;
using System.Text;

namespace PacketRush.Core
{
    public class ClientTestService : INetService
    {
        PacketReader _PacketReader = new PacketReader();

        #region INetService Members

        public void DeliverPacket(Packet packet)
        {
            _PacketReader.RawPacket = packet;
            string message = _PacketReader.ReadString(Encoding.UTF8);
            if (message != "Hello World") throw new Exception("Message invalid");
            Console.WriteLine(message);
        }

        public Packet CollectPacket()
        {
            return null;
        }

        public void Initialize(NetBase host)
        {
            
        }

        #endregion
    }
}
